﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:ctrl="clr-namespace:MediaOwl.Common.ControlTemplates;assembly=MediaOwl.Common"
             xmlns:cal="http://www.caliburnproject.org"
             x:Class="MediaOwl.Views.MainView"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">
    <UserControl.Resources>
        <Style x:Key="MenuItemContainerStyle"
               TargetType="ListBoxItem">
            <Setter Property="Padding"
                    Value="3" />
            <Setter Property="HorizontalContentAlignment"
                    Value="Left" />
            <Setter Property="VerticalContentAlignment"
                    Value="Top" />
            <Setter Property="Background"
                    Value="Transparent" />
            <Setter Property="BorderThickness"
                    Value="1" />
            <Setter Property="TabNavigation"
                    Value="Local" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid Background="{TemplateBinding Background}">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.2" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0"
                                                             To="0.4"
                                                             Storyboard.TargetProperty="Opacity"
                                                             Storyboard.TargetName="contentPresenter" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.2" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Unselected" />
                                    <VisualState x:Name="Selected" />
                                    <VisualState x:Name="SelectedUnfocused" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates"
                                                  ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0:0:0.2" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Focused" />
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="LayoutStates">
                                    <VisualState x:Name="AfterLoaded" />
                                    <VisualState x:Name="BeforeLoaded" />
                                    <VisualState x:Name="BeforeUnloaded" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <VisualStateManager.CustomVisualStateManager>
                                <ei:ExtendedVisualStateManager />
                            </VisualStateManager.CustomVisualStateManager>
                            <ContentPresenter x:Name="contentPresenter"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              Margin="2" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>

        <toolkit:DockPanel Margin="10">
            <toolkit:DockPanel>
                <StackPanel toolkit:DockPanel.Dock="Top"
                            Orientation="Horizontal"
                            Margin="0,0,0,10" HorizontalAlignment="Right">
                    <Button x:Name="SelectModules"
                            Style="{StaticResource OpacityButton}"
                            Margin="0,0,10,0" ToolTipService.ToolTip="Select Modules">
                        <Image Source="/MediaOwl;component/Resources/Icons/modules.png"
                               Width="30"
                               Height="30" />
                    </Button>
                    <Button x:Name="ShowInfo"
                            Style="{StaticResource OpacityButton}" ToolTipService.ToolTip="Information about MediaOwl">
                        <Image Source="/MediaOwl;component/Resources/Icons/info.png"
                               Width="30"
                               Height="30" />
                    </Button>
                </StackPanel>
                <ListBox x:Name="Items"
                         Background="Transparent"
                         BorderBrush="Transparent"
                         Foreground="Transparent"
                         Margin="15,0,0,10"
                         toolkit:DockPanel.Dock="Top"
                         Padding="10"
                         ItemTemplate="{StaticResource WorkspaceItemTemplate}"
                         ItemContainerStyle="{StaticResource MenuItemContainerStyle}" />
            </toolkit:DockPanel>
            <toolkit:TransitioningContentControl x:Name="ActiveItem"
                                                 HorizontalContentAlignment="Stretch"
                                                 VerticalContentAlignment="Stretch"
                                                 Transition="DownTransition"
                                                 Margin="15,40,15,10" />
        </toolkit:DockPanel>
        <ctrl:DialogIndicator cal:View.Model="{Binding CurrentBusyViewModel}" d:IsHidden="True" />
        <ctrl:DialogIndicator cal:View.Model="{Binding ActiveDialog}" d:IsHidden="True" />
    </Grid>
</UserControl>
